package org.chw.callback.utils;

import java.util.Map;
import java.util.Set;

/**
 * @ClassName: WechatUtil
 * @Description: 微信工具
 * @Autor: Vincent.Chen
 * @Create: 2018/6/13 11:01
 * @Version: 1.0
 **/
public class WechatUtil {
  public static String jointURL(String baseUri, String path, Map<String, String> param) {
    StringBuilder sb = new StringBuilder();
    sb.append(baseUri).append(path).append("?");
    Set<String> keys = param.keySet();
    for (String key : keys) {
      sb.append(key).append("=").append(param.get(key)).append("&");
    }
    String URL = sb.toString();
    return URL.substring(0, URL.length() - 1);
  }
}
